package maze.levels;

import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import javax.imageio.ImageIO;

/**
 *
 * @author loki
 */
public abstract class BaseTag {
    protected String description;
    
    private BufferedImage image;
    
    public BaseTag(URL imageURL, String description) throws IOException {        
        this.image = ImageIO.read(imageURL);
        this.description = description;
    }
    
    public Image getImage() {
        return image;
    }
    
    public String getDescription() {
        return this.description;
    }
    
    public void paint(Graphics2D g2d, double x, double y, double scaleX, double scaleY) {
        g2d.drawImage(image, (int)(scaleX * x) + 1, (int)(scaleY * y) + 1, (int)(scaleX - 2), (int)(scaleY - 2), null);
    }
}
